package com.js.myapp.system.activity;

// Created by JS on 2021/5/14.

import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;

import androidx.annotation.Nullable;

import com.google.android.material.shape.CornerFamily;
import com.google.android.material.shape.RelativeCornerSize;
import com.google.android.material.shape.ShapeAppearanceModel;
import com.js.basicpage.activity.BaseLoadingDialogActivity;
import com.js.basicutils.NavigationBarUtil;
import com.js.basicutils.StatusBarUtil;
import com.js.myapp.R;
import com.js.myapp.databinding.ActivityShapeImageBinding;

public class ShapeImageActivity extends BaseLoadingDialogActivity {

    private ShapeImageActivity mContext;
    private ActivityShapeImageBinding binding;

    public static void start(Context context) {
        Intent intent = new Intent(context, ShapeImageActivity.class);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mContext = this;
        binding = ActivityShapeImageBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        NavigationBarUtil.setSysNavigationColor(this, Color.parseColor("#141d26"));
        StatusBarUtil.setStatusBarColor(this, R.color.color_statusbar_bg);
        initView();
    }

    private void initView() {
        ShapeAppearanceModel.Builder builder = new ShapeAppearanceModel.Builder();
        builder.setTopLeftCorner(CornerFamily.ROUNDED, new RelativeCornerSize(0.2f));
        builder.setTopRightCorner(CornerFamily.ROUNDED, new RelativeCornerSize(0.2f));
        builder.setBottomLeftCorner(CornerFamily.ROUNDED, new RelativeCornerSize(0.2f));
        builder.setBottomRightCorner(CornerFamily.ROUNDED, new RelativeCornerSize(0.2f));
        binding.ivCat.setShapeAppearanceModel(builder.build());
    }
}
